package com.demonzym.http.api;

import com.demonzym.activity.data.VideoUrlData;
import com.demonzym.framework.net.http.HttpRequest;
import com.demonzym.framework.net.http.HttpResponse;
import com.demonzym.framework.net.task.AbstractHttpTask;

public class GetVideoUrlTask extends AbstractHttpTask {
	
	private String id;
	
	public GetVideoUrlTask(String id){
		this.id = id;
	}
	
	@Override
	public HttpRequest buildHttpRequest() {
		HttpRequest hr = new HttpRequest(ConstUrl.TUDOU_VIDEO_URL + id);
		return hr;
	}

	@Override
	protected VideoUrlData buildResponseObject(HttpResponse hr) {
		return VideoUrlData.parseVideoUrl(new String(hr.data));
	}

	@Override
	protected int buildType() {
		return Api.GETVIDEOURL;
	}
}
